import axios from 'axios'
import md5 from '../../../static/md5.min'
import config from '../../config'

/**
 * 登陆
 * @param username 用户名
 * @param password 密码
 * @param platCode 平台代码
 */
export default {
  /**
   * 获取账户信息
   */
  getUserInfo () {
    return axios.get(config.ucDir + '/api/currentUser', {showLoading: false})
  },
  login (userName, password, platCode) {
    return axios.put(config.ucDir + '/login', {
      userName: userName,
      password: md5(password),
      platCode: 'S'
    })
  }
}
